//
//  HisTableViewCell.m
//  NewMusic
//
//  Created by dllo on 15/11/23.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "HisTableViewCell.h"

@interface HisTableViewCell ()
@property (nonatomic, retain) UILabel *label;
@end

@implementation HisTableViewCell
- (void)dealloc
{
    [_label release];
    [_str release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self creatSubView];
    }
    return self;
}
- (void)creatSubView
{
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(20, 15, 100, 30)];
    self.label.text = @"12345";
    self.label.textColor = [UIColor colorWithRed:220 / 255.0 green:220 / 255.0 blue:220 / 255.0 alpha:1.0];
    self.label.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:self.label];
    [_label release];
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(330, 25, 15, 15)];
    imageView.userInteractionEnabled = YES;
    imageView.image = [UIImage imageNamed:@"icon-delete"];
    [self.contentView addSubview:imageView];
    [imageView release];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
    [imageView addGestureRecognizer:tap];
    [tap release];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.label.text = self.str;
}
- (void)awakeFromNib {
    // Initialization code
}
- (void)tapAction
{
    [self.delegate deleteCell:self.num];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
